<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.sinodata.bsm.common.vo.FaultTrapMsg"%>
<%@ include file="../include/taglib.jsp"%>
<%
    response.setHeader("Cache-Control", "no-store");
	response.setHeader("Pragrma", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>TRAP列表页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<%@ include file="../include/common.jsp"%>
<%@ include file="../include/table.jsp"%>
<%@ include file="../include/jbox.jsp"%>

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/sub_menu.css" />

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/fault/trap.css" />
	
<script type="text/javascript" src="${pageContext.request.contextPath}/js/calendar/zh_CN_WdatePicker.js"></script>

<script type=text/javascript>

	function search(){
		var oTable=$("#trapList").dataTable();
		oTable.fnPageChange("first",true);
	}
	
	function deleteRule(id){
		var submit = function (v, h, f) {
		    if (v == 'ok') {
		    	$.ajax({
		    		type : "POST",
		    		url : "${pageContext.request.contextPath}/fault/trap-rule!delete.action", //请求的action
		    		data : {id:id}, //传的参数
		    		dataType : 'json',
		    		success : function(data) { //结果
		    			search();
		    		}
		    	});
		    }
		    else if (v == 'cancel') {
		    }
		    return true; //close
		};
		getTopWin(window).jBox.confirm("确定要删除数据吗？", "提示", submit);
	}
	
	function add(){
	     window.location.href="${pageContext.request.contextPath}/fault/trap-rule!add.action?resId="+'${resId}';
	}
	
	
	$(function() {
		//加载grid
		var oTable=	$('#trapList').dataTable({
			"bProcessing": false, 
			"bServerSide": true,
			"sServerMethod": 'POST',
			"sAjaxSource":'${pageContext.request.contextPath}/fault/trap-rule!list.action?resId='+${resId},
			"bPaginate": false,
			"bSort": true,
			"bFilter":false,
			"bJQueryUI":false,
			"sPaginationType": "full_numbers",
			"sDom":'rt <"bottom"flpi>',
			"aoColumns":[
                {"mDataProp":"op","":"center","bSortable": false},
                {"mDataProp":"name"},
				{"mDataProp":"eventlev"},
				{"mDataProp":"eventtype"},
				{"mDataProp":"securitylev"},
				{"mDataProp":"errorstatus"},
				{"mDataProp":"generic"},
				{"mDataProp":"msg"}
			], 
			 "oLanguage": { 
 				"sZeroRecords": "  ",
				"sInfo": "共 _TOTAL_ 条记录", 
				"sInfoEmpty": "没有找到记录",
			}
		});	
		
		$('#ip').bind('keyup', function(event){
			   if (event.keyCode=="13"){
				   search();
			   }
		});
	});
</script>

</head>
<body >
	
	<!--  
	<div class="top" id="top" style="">
		<ul>
		    <li class="li-a" idValue="common"><a id="return" name="common"
				href="trap!common.action" class="perf">TRAP列表</a>
			</li>
			<li>|</li> 
			<li class="li-a" idValue="common"><a id="return" name="common"
				href="trap!rule.action" class="perf">匹配事件</a>
			</li>
		</ul>
	</div>
	-->
	<div class="toolbar toolbar-w" >
	   <a class="page_edit" href="javascript:add();">新增TRAP派生规则</a>
	</div>
	<div>
	<table id="trapList" width="99%"  cellpadding="0" cellspacing="0" border="0" class="display" >
		<thead>
			<tr>
			    <th width="60px">操作</th>
			    <th width="7%">规则名称</th>
				<th width="7%">事件级别</th>
				<th width="10%">事件类别</th>
				<th width="2%">过滤安全级别</th>
				<th width="5%">过滤差错状态</th>
				<th width="5%">过滤Trap类别</th>
				<th >过滤消息内容</th>
			</tr>
		</thead>
	</table>
	</div>
</body>
</html>